<template>
    <div class="banner">
        <div class="banners">
            <van-swipe class="my-swipe" :autoplay = 3000 loop>
                <van-swipe-item v-for="item in a" :key="item.id">
                    <div class="img-box">
                        <img class="img-auto" :src="item.adImg" />
                    </div>
                </van-swipe-item>
            </van-swipe>
        </div>
    </div>
</template>

<script>
import { getBanner } from "../api/Banner.js";
export default {
    name: "Banner",
    components: {
    },
    data() {
        return {
            a: [],
        };
    },

    methods: {},

    created() {
        // console.log(homeBanner);
        getBanner().then(data=>{
            this.a = data.Banner
            // console.log(this.a);
        })
    },
};
</script>

<style lang="less" scoped>

::v-deep{
    .van-swipe__track{
        display: flex;
    }
}
.img-box {
    // width: 375px;    
    height: 300px;
    .img-auto {
        width: 100%;
        display: block;
    }
}
</style>
